import { PageReq } from "@/typings/api";
import { Permission, CreatePermissionReq, UpdatePermissionReq } from "@/typings/api/permission";
import { request } from "@/utils/request";

export const getPermissionList = (params?: PageReq<Permission>) => request.get("/permission");
export const getUserPermission = () => request.get("/permission/userPermission");
export const getPermissionRecord = (_id: string) => request.get(`/permission/${_id}`);
export const createPermission = (data: CreatePermissionReq) => request.post<Permission>("/permission", data);
export const updatePermission = (data: UpdatePermissionReq) => request.put("/permission", data);
export const deletePermission = (_id: string) => request.delete("/permission", { data: { _id } });
